package com.roadmap.client.auth;

import java.util.Date;

import com.roadmap.entities.Aspirant;
import com.roadmap.entities.Registration;
import com.roadmap.exception.DuplicateEntityException;
import com.roadmap.exception.EntityNotFoundException;
import com.roadmap.exception.InvalidActionException;
import com.roadmap.exception.InvalidValueException;
import com.roadmap.exception.NotRegisteredException;
import com.roadmap.exception.NullObjectException;
import com.roadmap.exception.ServerException;

public interface IRegisterServices {
	/** try to get a registration record from database */
	public Registration getRegFromDB(String mail) throws ServerException,
			NullObjectException, InvalidValueException, InvalidActionException;

	/**
	 * get validation codes for mail
	 * 
	 * @param urlcode:
	 *            it consists of two parts: registration Id (32 characters) and
	 *            random code (6 characters)
	 */
	public String getValidateCodes(String mail, String ip)
			throws NullObjectException, ServerException, InvalidValueException,
			InvalidActionException, DuplicateEntityException;

	/**
	 * after validation of mail passed, finish registration with user inputs
	 */
	public Aspirant finishRegistration(String urlCode, String realName,
			String password, char sex, Date birthday, String ipAddress)
			throws ServerException, NullObjectException, InvalidValueException,
			InvalidActionException, EntityNotFoundException,
			DuplicateEntityException, NotRegisteredException;

	public void deleteRegistration(String mail) throws NullObjectException,
			ServerException, InvalidValueException, InvalidActionException;
}
